<%@ page language="java" import="java.util.*,com.king.cms.common.PowerParameter" pageEncoding="UTF-8"%>
<%@ include file="/hotel/include/css.jsp"%>
<%-- /*包含css样式表*/ --%>
<%  
	String pageFunc = "模版设置";		//功能描述
%>
<% 
	int pow=(PowerParameter.save | PowerParameter.cls | PowerParameter.list);
%>


<html xmlns:MSIE='http://www.microsoft.com/ie'>
	<head>
		<title><%=pageFunc%>
		</title>
		<style>   
    
  @media   all   
  {   
  MSIE\:CLIENTCAPS{behavior:url(#default#clientcaps)}   
  }   
  </style> 
		
<script language="JavaScript" src="<%=path%>/js/generalcheck.js"></script> 
		<script language="javascript">
		var width = 768;
var height = 1024;
	function doEnable()
	{
		form1.bmMc.disabled=false;
		form1.bmBzrs.disabled=false;
	}
	 
	function ki_save(){
      var flag = true;
      
	  if(clskg(document.getElementById("templateName").value) == '') {
	 	   alert('模版名称不能为空');
	 	   flag = false;
	 	   return;
	  }
	  if(clskg(document.getElementById("templateFile").value) == '') {
	 	   alert('模版文件不能为空');
	 	   flag = false;
	 	   return;
	  }
	 if(flag)
	    form1.submit();
	}
	function ki_cls(){
		document.getElementById("templateName").value='';
		document.getElementById("templateDesc").value='';
		document.getElementById("templateFile").value=''; 
		
	}
	function ki_list(){
		window.open('<%=basePath%>template.do?action=list','_self');
	}
	////////除去空格/////////
	function clskg(va){
	  var th=/\s/g;
	 va=va.replace(th,'');
	 return va;
	}
	function uploadfile(){
   openwindow('<%=path%>/hotel/template/upload.jsp','500','300','_blank');
 }
 function preview(){
		    if(clskg(document.getElementById("templateFile").value) == '') {
	 	  		 alert('请先上传模版文件');
	 	   	     return;
	  		}
	  		openwindow1('<%=path%>/hotel/template/preview.jsp?templateFile='+document.getElementById("templateFile").value+"&width="+width+"&height="+height,'','','');
		}
</script>
	</head>
	<body background="<%=imgpath%>top3.gif" leftmargin="0" topmargin="0"> 
	<MSIE:CLIENTCAPS   ID='idClient'/>  
<script   language='javascript'>   
    
  <!--   
  width = idClient.availWidth;
  height =  idClient.availheight;    
    
  -->   
    
  </script>  
	 <br> 
		 <center>
		<form name="form1" method="post"
			action="<%=basePath%>template.do?action=save"  >
			<table border="0" cellpadding="0" cellspacing="0" align="center" width="98%"
				height="2">
				<tr>
					<td width="9" height="1"></td>
					<td height="1" background="<%=path%>/img/images_06.gif">
						<p align="center">
							<b><%=pageFunc%></b></p>
					</td>
					<td width="9" height="1"></td>
				</tr>
			</table>
			<table height="48" border="0" cellpadding="2" cellspacing="1"
				class="bg_table" style="width:90%" bordercolor="#111111">
				<tr class="top_td">
					<td colspan="2" >
						添加模版
					</td>
				</tr>
				<tr class="td2">
					<td width="20%">
						模版名称
					</td>
					<td width="80%">
					<input type="hidden" name="fileType" value="">
					<input type="hidden" name="fileSaveName" value="">
						<input type="text" name="templateName" style="width:90%" class="area100"  check="c_n_50">
					</td>
					 
				</tr>
				<tr class="td2">
					<td width="20%">
						模版附件
					</td>
					<td width="80%">
						<input type="text" name="templateFile" style="width:83%" class="area100"  readonly> 
						<label> <input type="button" name="choiceupload" class="area100" value="选择"   onClick="uploadfile()"> </label>
					</td>
					 
				</tr>
				<tr class="td2">
					<td width="20%">
						模版说明
					</td>
					<td width="80%">
						<input type="text" name="templateDesc" style="width:90%" class="area100"  check="c_n_50">
					</td>
					 
				</tr>
				 
				<tr class="top_td">
					<td colspan="2" align="center"><input id="previewbutton"   type="button" onclick="preview()" class="area100" value="预览">
					</td>
				</tr>
			</table>
</form>
</center>
		</body>
</html>
<%@ include file="/hotel/pow.jsp"%>
